home *** CD-ROM | disk | FTP | other *** search
Wrap
; ----------------------------------------------------- ; Peace and Protection (by misspai) ; ----------------------------------------------------- ; Whois/Who display and a few ; misc. other raw events based on ; Whois/Who replies. ; ----------------------------------------------------- alias -l code { if ($right($1,3) != .US) return $read -ns [ $+ [ $gettok($1,$gettok($1,0,46),46) ] ] pp300\country.txt set %.cc.two $calc($gettok($1,0,46) - 1) $+ - $+ $gettok($1,0,46) set %.cc.two $read -ns [ $+ [ $gettok($1,%.cc.two,46) ] ] pp300\country.txt if (%.cc.two != $null) return %.cc.two return United States } alias country { set %.cc.found $code($1) if (%.cc.found == $null) dispa Location of %col.target $+ $1 $+ is unknown. else dispa Location of %col.target $+ $1 $+ - %.cc.found } alias usa country $1 $+ .us ; ----------------------------------------------------- ; Hiding of Who from IAL update, ; and clone scan on join ; ----------------------------------------------------- #_rawhalts off raw *:*:.disable #_rawhalts | return #_rawhalts end #-ialupdate2 off raw 315:*:{ set %-ial.update $remtok(%-ial.update,$2,32) if (%-ial.update == $null) .disable #-ialupdate #-ialupdate2 halt } #-ialupdate2 end #-ialupdate off raw 352:*:halt raw 315:*:{ set %-ial.update $remtok(%-ial.update,$2,32) if (%-ial.update == $null) .disable #-ialupdate #-ialupdate2 if ($2 ischan) { if (%+clonescan.youjoin) { set %.+sc.quiet %+clonescan.hide clones $2 unset %.+sc.quiet } set %.xw $_usebot($2,login) | if (%.xw != $null) _botcmd %.xw $2 $me if (join isin %autobot. [ $+ [ $2 ] ] ) { set %.xw $_usebot($2,opme) | if (%.xw != $null) _botcmd %.xw $2 $me } if (((X ison $2) || (W ison $2)) && (%pp.net == undernet)) if (%-recentpart. [ $+ [ $2 ] ] < 1) auto xpq $2 } halt } #-ialupdate end ; ----------------------------------------------------- ; Channel scan ; ----------------------------------------------------- #-chanscan off raw 352:*:{ if ((%pp.net == undernet) && ($6 isin xw) && ($3 == cservice) && ($4 == undernet.org)) halt if (G isin $7) { inc %-cscan.gone | set %-cscan.away %-cscan.away $6 } else inc %-cscan.here if (* isin $7) { set %-cscan.ircops %-cscan.ircops $6 } inc %-cscan.hops $8 if (%-cscan. [ $+ [ $5 ] ] == $null) { set %-cscan. [ $+ [ $5 ] ] $8 $6 set %-cscan.servs $addtok(%-cscan.servs,$5,32) } else set %-cscan. [ $+ [ $5 ] ] %-cscan. [ $+ [ $5 ] ] $6 halt } raw 315:*:{ set %-cscando $remtok(%-cscando,$2,32) if (%-cscando == $null) .disable #-chanscan if (%-cscan.gone == $null) set %-cscan.gone 0 %-cscan.total = %-cscan.gone + %-cscan.here set %-cscan.type %-cscantype. [ $+ [ $2 ] ] set %-cscan.type. [ $+ [ $2 ] ] set %-cscan.head $2 [[ $+ %col.info1 $+ $lower($2) $+ ] if ($remove(%-cscan.type,r) != d) { if (r isin %-cscan.type) { set %-cscan.head @Scan [[ $+ %col.info1 $+ $lower($2) $+ ] window -c @Scan window -a $+ $_spec1d @Scan $_winpos(14%,7%,8%,8%) @Close %font.basic titlebar @Scan for $2 } disprs-div %-cscan.head disprs %-cscan.head Scan results for %col.target $+ %-cscan.total $+ users- } if (a isin %-cscan.type) disprs %-cscan.head away- %col.dark $+ $+ %-cscan.gone $+ $_plural(user,%-cscan.gone) away %col.dark $+ ( $+ $_p(%-cscan.gone,%-cscan.total) $+ ) - %col.dark $+ $+ %-cscan.here $+ $_plural(user,%-cscan.here) not away %col.dark $+ ( $+ $_p(%-cscan.here,%-cscan.total) $+ ) if (w isin %-cscan.type) { if (%-cscan.gone == 0) { if (a !isin %-cscan.type) disprs %-cscan.head away- no users are away } else disprs %-cscan.head away- %col.dark $+ $_s2cs(%-cscan.away) } if (i isin %-cscan.type) { if (%-cscan.ircops == $null) disprs %-cscan.head ircops- no ircops found else { set %-cscan.num $_numtok(32,%-cscan.ircops) disprs %-cscan.head ircops- %col.dark $+ $+ %-cscan.num $+ $_plural(ircop,%-cscan.num) %col.dark $+ ( $+ $_p(%-cscan.num,%-cscan.total) $+ ) disprs %-cscan.head ircops- %col.dark $+ $_s2cs(%-cscan.ircops) } } if (h isin %-cscan.type) disprs %-cscan.head hops- average server hops %col.dark $+ $+ $_round($calc(%-cscan.hops / %-cscan.total),2) if ((s isin %-cscan.type) || (l isin %-cscan.type)) { set %-cscan.best $server set %-cscan.num %-cscan. [ $+ [ $server ] ] set %-cscan.num $calc($_numtok(32,%-cscan.num) - 2) set %-cscan.todo $_numtok(32,%-cscan.servs) :loop1 set %-cscan.serv $gettok(%-cscan.servs,%-cscan.todo,32) set %-cscan.chk %-cscan. [ $+ [ %-cscan.serv ] ] set %-cscan.chk $_j($_numtok(32,$remtok(%-cscan.chk,$me,32))) if (%-cscan.chk > %-cscan.num) { set %-cscan.num %-cscan.chk | set %-cscan.best %-cscan.serv } if ($_vd(-cscan.todo) > 0) goto loop1 if (s isin %-cscan.type) { if (%-cscan.best == $server) { inc %-cscan.num | disprs %-cscan.head server- favorite server is your server, %col.info2 $+ %-cscan.best $+ , with %col.dark $+ $+ %-cscan.num $+ $_plural(user,%-cscan.num) $+ , including you %col.dark $+ ( $+ $_p(%-cscan.num,%-cscan.total) $+ ) } else { disprs %-cscan.head server- favorite server is %col.info2 $+ %-cscan.best $+ , with %col.dark $+ $+ %-cscan.num $+ $_plural(user,%-cscan.num) %col.dark $+ ( $+ $_p(%-cscan.num,%-cscan.total) $+ ) if (%+disp.options) disprs %-cscan.head server- %col.option $+ ShiftF9 to change to this server | set %_sf9.server %-cscan.best } } if (l isin %-cscan.type) { set %-cscan.who %-cscan. [ $+ [ %-cscan.best ] ] if (s isin %-cscan.type) disprs %-cscan.head server- users on favorite server- %col.dark $+ $_s2cs($gettok(%-cscan.who,2-,32)) else disprs %-cscan.head server- users on favorite server, %col.info2 $+ %-cscan.best $+ - %col.dark $+ $_s2cs($gettok(%-cscan.who,2-,32)) } } else unset %-cscan.best if (m isin %-cscan.type) { set %-cscan.who %-cscan. [ $+ [ $server ] ] set %-cscan.num $calc($_numtok(32,%-cscan.who) - 2) if ((%-cscan.best != $server) || (s !isin %-cscan.type)) disprs %-cscan.head server- %col.dark $+ $+ %-cscan.num $+ other $_plural(user,%-cscan.num) on your server %col.dark $+ ( $+ $_p(%-cscan.num,%-cscan.total) $+ , or $_p($_i(%-cscan.num),%-cscan.total) including yourself) if (((%-cscan.best != $server) || (l !isin %-cscan.type)) && (%-cscan.num > 0)) disprs %-cscan.head server- other users on your server- %col.dark $+ $_s2cs($remtok($gettok(%-cscan.who,2-,32),$me,32)) } if ($remove(%-cscan.type,r) != d) disprs-div %-cscan.head if (d isin %-cscan.type) { window -c @Server window -l $+ $_spec1d @Server $_winpos(14%,7%,8%,8%) @Server %font.basic set %-cscan.todo $_numtok(32,%-cscan.servs) titlebar @Server usage for $2 ( $+ %-cscan.total users, %-cscan.todo servers) :loop2 set %-cscan.serv $gettok(%-cscan.servs,%-cscan.todo,32) set %-cscan.info %-cscan. [ $+ [ %-cscan.serv ] ] set %-cscan.hop $gettok(%-cscan.info,1,32) set %-cscan.info $gettok(%-cscan.info,2-,32) set %-cscan.cnt $_numtok(32,%-cscan.info) set %.line 1 :loop3 if (%.line <= $line(@Server,0)) { if ($strip($remove($gettok($line(@Server,%.line),4,32),$chr(40))) < %-cscan.hop) { inc %.line | goto loop3 } } iline @Server %.line $chr(160) ò %col.info2 $+ %-cscan.serv $+ ( $+ %col.att $+ %-cscan.hop $+ $_plural(hop,%-cscan.hop) $+ ) - %col.misc $+ (ping unknown) - %col.dark $+ %-cscan.cnt $+ $_plural(user,%-cscan.cnt) %col.dark $+ ( $+ $_p(%-cscan.cnt,%-cscan.total) $+ ) - $_s2cs(%-cscan.info) if ($_vd(-cscan.todo) > 0) goto loop2 iline @Server 1 Currently sorted by server hops (closest servers first) iline @Server 2 Double click to connect to a server, right-click for options iline @Server 3 $chr(160) window -b @Server unset %_serv.pop1 %_serv.pop4 %_serv.pop4o set %_serv.pop2 Sort by number of users set %_serv.pop3 Sort by server name } unset %-cscan.* } #-chanscan end ; ----------------------------------------------------- ; Display of WhoWas info ; ----------------------------------------------------- #-whowashide off raw 369:*:.disable #-whowashide #-whowasaway | halt #-whowashide end #-whowasaway off raw 301:*:if (%-+findingu. [ $+ [ $2 ] ] != $null) halt | set %.dw.rest $+ %col.dark | _disp.whois $_whoisnick($2) was away ½ $+ %col.dark $+ $replace($3-,,%.dw.rest) $+ ╗ | halt raw 312:*:{ if (%-+findingu. [ $+ [ $2 ] ] != $null) { _fuser2 $2 $3 | .enable #-whowashide | halt } if ($4 == $null) unset %.ww.opt | else set %.ww.opt , signed off %col.info1 $+ $4- _disp.whois $_whoisnick($2) was on %col.info1 $+ $3 $+ $+ %.ww.opt set %_last.serv $3 | set %_sf9.server $3 if (%whois.showcc) { if ($findtok(net.org.com.edu,$gettok(%_last.whois.addr,$gettok(%_last.whois.addr,0,46),46),46) != $null) halt set %.cc.found $code(%_last.whois.addr) if (%.cc.found != $null) _disp.whois $_whoisnick($2) was at %col.info1 $+ %.cc.found } halt } #-whowasaway end raw 314:*:{ if (%-+findingu. [ $+ [ $2 ] ] ) { set %-+findingu. [ $+ [ $2 ] ] $3 | .enable #-whowasaway | halt } unset %-ww.nick if ($_isopen(%whois.route) == $false) open @Whois dispr-div %whois.route | _disp.whois-div _disp.whois %col.whois $+ $2 $+ was %col.info1 $+ $3 $+ @ $+ %col.info1 $+ $4 _disp.whois $_whoisnick($2) was ½ $+ %col.dark $+ $6- $+ ╗ unset %^follow.* %_last.whois.chan %_last.whoisc set %_last.whois $2 | set %_last.whois.identd $3 | set %_last.whois.addr $4 set %_last.whoisf $2! $+ $3@ $+ $4 | set %_last.whoisr * $6- | set %_last.whoist was .enable #-whowasaway | halt } raw 406:*:if (%-+findingu. [ $+ [ $2 ] ] ) { set %-+findingu. [ $+ [ $2 ] ] | dispa There was no such user %col.target $+ $2 | .enable #-whowashide } | else { unset %-ww.nick | if ($_isopen(%whois.route) == $false) open @Whois | dispr-div %whois.route | _disp.whois-div | _disp.whois There was no such user %col.whois $+ $2 } | halt raw 369:*:if ($_isopen(%whois.route)) dispr-div %whois.route | .disable #-whowasaway | halt ; ----------------------------------------------------- ; Display of Whois info ; ----------------------------------------------------- #-whoisaway off raw 301:*:if (%-+hidewhois. [ $+ [ $2 ] ] ) halt | set %.dw.rest $+ %col.dark | _disp.whois $_whoisnick($2) is away ½ $+ %col.dark $+ $replace($3-,,%.dw.rest) $+ ╗ | halt #-whoisaway end raw 310:*:if (%-+hidewhois. [ $+ [ $2 ] ] ) halt | _disp.whois $_whoisnick($2) $3- | halt raw 307:*:if (= isin $2) halt | if (%-+hidewhois. [ $+ [ $2 ] ] ) halt | _disp.whois $_whoisnick($2) $3- | halt raw 308:*:if (%-+hidewhois. [ $+ [ $2 ] ] ) halt | _disp.whois $_whoisnick($2) $3- | halt raw 309:*:if (%-+hidewhois. [ $+ [ $2 ] ] ) halt | _disp.whois $_whoisnick($2) $3- | halt raw 311:*:{ .enable #-whoisaway if (%-+hidewhois. [ $+ [ $2 ] ] ) halt set %-ww.nick $2 if (%-waitwhois. [ $+ [ $2 ] ] != $null) if (%+whois.inchan) goto usagi if ($_isopen(%whois.route) == $false) open @Whois dispr-div %whois.route :usagi _disp.whois-div _disp.whois %col.whois $+ $2 $+ is %col.info1 $+ $3 $+ @ $+ %col.info1 $+ $4 _disp.whois $_whoisnick($2) is ½ $+ %col.dark $+ $6- $+ ╗ unset %^follow.* %_last.whois.chan %_last.whoisc set %_last.whois $2 | set %_last.whois.identd $3 | set %_last.whois.addr $4 set %_last.whoisf $2! $+ $3@ $+ $4 | set %_last.whoisr * $6- | set %_last.whoist is | inc %-num.whois | halt } raw 312:*:{ if ($findtok(%-sping.user,$2,32) != $null) sping $2 $3 if (%-+hidewhois. [ $+ [ $2 ] ] ) halt if (%+disp.options) set %.ww.opt %col.option $+ (ShiftF9 to change to this server) | else unset %.ww.opt _disp.whois $_whoisnick($2) on %col.info1 $+ $3 $+ %.ww.opt if (%+whois.servername) _disp.whois $_whoisnick($2) on %col.info1 $+ $4- set %_last.serv $3 | set %_sf9.server $3 if (%whois.showcc) { if ($findtok(net.org.com.edu,$gettok(%_last.whois.addr,$gettok(%_last.whois.addr,0,46),46),46) != $null) halt set %.cc.found $code(%_last.whois.addr) if (%.cc.found != $null) _disp.whois $_whoisnick($2) at %col.info1 $+ %.cc.found } halt } raw 313:*:if (%-+hidewhois. [ $+ [ $2 ] ] ) halt | _disp.whois $_whoisnick($2) an IRCop | halt raw 316:*:if (%-+hidewhois. [ $+ [ $2 ] ] ) halt | _disp.whois $_whoisnick($2) $3- | halt raw 317:*:if (%-+hidewhois. [ $+ [ $2 ] ] ) halt | if ($4 !isnum) _disp.whois $_whoisnick($2) is idle %col.dark $+ $duration($3) | else _disp.whois $_whoisnick($2) is idle %col.dark $+ $duration($3) $+ , signed on %col.info1 $+ [[ $+ $asctime($4) $+ ]] | halt raw 318:*:{ .disable #-whoisaway #-whoisno if (%-+hidewhois. [ $+ [ $2 ] ] ) { set %-+hidewhois. [ $+ [ $2 ] ] | set %-waitwhois. [ $+ [ $2 ] ] | if ($findtok(%-sping.user,$2,32) != $null) dispa No user %col.target $+ $2 $+ found to serverping. | set %-sping.user $remtok(%-sping.user,$2,32) | halt } if ((%-num.whois > 1) || (. isin $2) || (* isin $2) || (? isin $2) || ($2 == 0)) { if (@ isin %whois.route) _disp.whois End of whois %col.whois $+ ( $+ $2 $+ ) %col.option $+ (right-click for options) else _disp.whois End of whois %col.whois $+ ( $+ $2 $+ ) %col.option $+ (see "PP Tools...Do to last /whois" for options) } if ((%-waitwhois. [ $+ [ $2 ] ] != $null) && (%+whois.inchan)) dispr-div %-waitwhois. [ $+ [ $2 ] ] elseif ($_isopen(%whois.route)) dispr-div %whois.route set %-waitwhois. [ $+ [ $2 ] ] unset %-num.whois | halt } raw 319:*:{ if (%-ccwhois. [ $+ [ $2 ] ] != $null) { set %.cc.chans %-ccwhois. [ $+ [ $2 ] ] set %.cc.num $_numtok(32,%.cc.chans) :loop1 set %.cc.cha $gettok(%.cc.chans,%.cc.num,32) set %.cc.on $remtok($_format.chans2($3-),%.cc.cha,44) set %.cc.onnum $_numtok(44,%.cc.on) if ((%.cc.onnum > 0) && ($me isop %.cc.cha)) { set %.cc.perv $_setting(match.chancheck,%.cc.cha) :loop2 set %.cc.onchk $gettok(%.cc.on,%.cc.onnum,44) set %.cc.pnum $_numtok(32,%.cc.perv) :loop3 set %.cc.pchk $gettok(%.cc.perv,%.cc.pnum,32) if (%.cc.pchk iswm %.cc.onchk) { _prog.punish chancheck ChannelCheck %.cc.onchk %.cc.pchk %.cc.cha $2 $2 $gettok($address($2,5),2,64) if ($result == warn) .timer 1 30 _recch $2 %.cc.cha goto next } if ($_vd(.cc.pnum) > 0) goto loop3 if ($_vd(.cc.onnum) > 0) goto loop2 } :next if ($_vd(.cc.num) > 0) goto loop1 set %-ccwhois. [ $+ [ $2 ] ] } if (%-+hidewhois. [ $+ [ $2 ] ] ) halt set %.wd.wrap $calc(%linewrap.whois - $len($2) - 10) if ((%linewrap.whois > 0) && ($len($3-) > %.wd.wrap) && (%.wd.wrap > 15)) { set %.wd.chans $3- :loopc if ($len(%.wd.chans) <= %.wd.wrap) set %.wd.todo %.wd.chans else { set %.wd.todo $left(%.wd.chans,%.wd.wrap) set %.wd.todo $_ltok($_j($_numtok(32,%.wd.todo)),32,%.wd.todo) } _disp.whois $_whoisnick($2) on $_format.chans(%.wd.todo) set %.wd.chans $remtok($remove(%.wd.chans,%.wd.todo),!,32) if (%.wd.chans != $null) goto loopc } else _disp.whois $_whoisnick($2) on $_format.chans($3-) set %_last.whoisc $3- set %_last.whois.chan $_format.chans2($3-) if ($chr(160) isin $3-) _disp.whois $_whoisnick($2) on a channel name containing fake spaces. (could be a "fake" channel) elseif (( isin $3-) || ( isin $3-) || ( isin $3-) || ( isin $3-) || ( isin $3-)) _disp.whois $_whoisnick($2) on a channel name containing format codes. (could be a "fake" channel) unset %^follow.* | set %.dw.num $_numtok(44,%_last.whois.chan) if (%.dw.num == 10) _disp.whois $_whoisnick($2) is on an awful lot of channels, don't you think? :loop | set %^follow. [ $+ [ %.dw.num ] ] $gettok(%_last.whois.chan,%.dw.num,44) | if ($_vd(.dw.num) > 0) goto loop halt } ; ----------------------------------------------------- ; Display of "no such user" ; ----------------------------------------------------- raw 401:*failed to deliver*:{ if ($chr(1) isin $9) disps Someone left %pp.net before they could reply to the CTCP %col.info2 $+ $_rchop(2,$9) $+ you sent them. else disps The person you sent this message to has left %pp.net $+ - %col.dark $+ $9- halt } #-whoisno off raw 401:*no such*:if (%-+hidewhois. [ $+ [ $2 ] ] ) halt | unset %-ww.nick | if ($_isopen(%whois.route) == $false) open @Whois | dispr-div %whois.route | _disp.whois-div | _disp.whois No such user %col.whois $+ $2 | halt #-whoisno end raw 401:*no such*:{ set %.iden $gettok($2,1,64) if (%-+findping. [ $+ [ %.iden ] ] == $2) { set %-+findping. [ $+ [ %.iden ] ] dispa No new nickname could be located for %col.target $+ %-+findpingn. [ $+ [ %.iden ] ] $+ (user probably left IRC) set %-+findpingn. [ $+ [ %.iden ] ] halt } if (%-isnosuch. [ $+ [ $2 ] ] <= 0) { if ($_ischan($2)) disps [[ $+ %col.info1 $+ $lower($2) $+ ] No such channel else disprs $2 No such user %col.target $+ $2 } _timersinc 15 -isnosuch. $+ $2 halt } ; ----------------------------------------------------- ; Display of away info ; ----------------------------------------------------- raw 301:*:{ if ($2 != $me) { if (%-isaway. [ $+ [ $2 ] ] <= 0) { set %.dw.rest $+ %col.dark dispr $2 %col.target $+ $2 $+ is away ½ $+ %col.dark $+ $replace($3-,,%.dw.rest) $+ ╗ } _timersinc 60 -isaway. $+ $2 } halt } ; ----------------------------------------------------- ; Display of Who info ; ----------------------------------------------------- raw 354:*:inc %-num.who | _disp.whois $2- | halt raw 352:*:{ unset %-ww.nick if (%-num.who == $null) { if ($_isopen(%whois.route) == $false) open @Whois | dispr-div %whois.route | _disp.whois-div } if (G isin $7) set %.who.away AWAY | else set %.who.away NOT AWAY if (* isin $7) set %.who.ircop IRCop | else unset %.who.ircop if (+ isin $7) set %.who.op + | elseif (@ isin $7) set %.who.op @ | else unset %.who.op if (d isin $7) set %.who.deaf (deaf) | else unset %.who.deaf if (%+who.two.line) { _disp.whois %col.whois $+ $6 $+ %col.info3 $+ %.who.op $+ $+ $left($2,1) $+ %col.dark $+ $_rchop(1,$2) $+ %col.who1 $+ $3 $+ @ $+ $4 $+ %col.info2 $+ %.who.away $+ %.who.ircop %.who.deaf _disp.whois $str($chr(160),3) ½ $+ %col.who2 $+ $9- $+ ╗ ½ $+ %col.who3 $+ $5 $+ ╗ %col.option $+ Hops: $8 $+ } else _disp.whois %col.whois $+ $6 $+ %col.info3 $+ %.who.op $+ $+ $left($2,1) $+ %col.dark $+ $_rchop(1,$2) $+ %col.who1 $+ $3 $+ @ $+ $4 $+ ½ $+ %col.who2 $+ $9- $+ ╗ ½ $+ %col.who3 $+ $5 $+ ╗ %col.option $+ Hops: $8 $+ %col.info2 $+ %.who.away $+ %.who.ircop %.who.deaf inc %-num.who | halt } raw 315:*:if (%-num.who < 1) _disp.whois No users found %col.whois $+ ( $+ $2 $+ ) | elseif ((%-num.who > 1) || (. isin $2) || (* isin $2) || (? isin $2)) _disp.whois End of who %col.whois $+ ( $+ $2 $+ ) | if ($_isopen(%whois.route)) dispr-div %whois.route | unset %-num.who | halt ; ----------------------------------------------------- ; Internal aliases and identifiers ; for Whois/Who display ; ----------------------------------------------------- alias _disp.whois-div { if (%+time.stamp) { if (%+whois.log) write $_wrapfile($logdirwhois.log) $timestamp $strip(%@w) $strip(%=) if (%+whois.retain) write $_ppdir $+ who-temp.txt $+ %col.base $+ $timestamp %@w %= } else { if (%+whois.log) write $_wrapfile($logdirwhois.log) $strip(%@w) $strip(%=) if (%+whois.retain) write $_ppdir $+ who-temp.txt %@w %= } } alias _disp.whois { if ($1 == $null) return | set %_last.disp $1- if ((%-waitwhois. [ $+ [ %-ww.nick ] ] != $null) && (%+whois.inchan)) { set %.oldwr %whois.route set %whois.route %-waitwhois. [ $+ [ %-ww.nick ] ] } else unset %.oldwr if ($_isopen(%whois.route) == $false) open @Whois if ((%+whois.to.front) && (@ isin %whois.route)) window -ar @Whois if (%+time.stamp) set %.dw.show $timestamp %@w $1- | else set %.dw.show %@w $1- if (@ isin %whois.route) echo %col.base -i2 %whois.route %.dw.show else echo %col.base %whois.route %.dw.show if (%+whois.log) write $_wrapfile($logdirwhois.log) $strip(%.dw.show) if (%+whois.retain) write $_ppdir $+ who-temp.txt $+ %col.base $+ $replace(%.dw.show,, [ $+ [ %col.base ] ] ) if (%.oldwr != $null) set %whois.route %.oldwr } alias _whoisnick if ((%whois.nicks == Off) || ($len($1) > 15)) return $str($chr(160),3) | if (%whois.nicks == Hide) return $_color(back) $+ $+ $1 $+ | return %col.whois $+ $1 $+ alias _format.chans { set %.fc.num $_numtok(32,$1-) set %.fc.cur 1 unset %.fc %.+fc.deaf :loop set %.fc.z $gettok($1-,%.fc.cur,32) if ($left(%.fc.z,1) == -) { set %.fc.z $_rchop(1,%.fc.z) | set %.+fc.deaf $true } if (($left(%.fc.z,1) isin +@) && ($mid(%.fc.z,2,1) isin )) set %.fc %.fc %col.info3 $+ $left(%.fc.z,1) $+ $+ $mid(%.fc.z,2,1) $+ %col.dark $+ $_rchop(2,%.fc.z) else set %.fc %.fc $+ $left(%.fc.z,1) $+ %col.dark $+ $_rchop(1,%.fc.z) if ($_vi(.fc.cur) <= %.fc.num) goto loop if (%.+fc.deaf) return (deaf) %.fc return %.fc } alias _format.chans2 { set %.fc.num $_numtok(32,$1-) set %.fc.cur 1 unset %.fc :loop set %.fc.z $gettok($1-,%.fc.cur,32) if ($left(%.fc.z,1) == -) set %.fc.z $_rchop(1,%.fc.z) if (($left(%.fc.z,1) isin +@) && ($mid(%.fc.z,2,1) isin )) set %.fc %.fc $_rchop(1,%.fc.z) else set %.fc %.fc %.fc.z if ($_vi(.fc.cur) <= %.fc.num) goto loop return $_s2c(%.fc) } ; ----------------------------------------------------- ; Delete whois log on startup ; ----------------------------------------------------- on 1:start:set %.who.file $_ppdir $+ who-temp.txt | if ($exists(%.who.file)) .remove %.who.file ; ----------------------------------------------------- ; Last seen ; ----------------------------------------------------- #lastseen off alias -l _dpseen { if ($comchan($nick($chan,$1),0) == 1) { if ($nick($chan,$1) == $remove($gettok($gettok($address($nick($chan,$1),5),2-,33),1,64),~)) _sseen $nick($chan,$1) $ctime $+ $nick($chan,$1) $+ ! $+ $gettok($address($nick($chan,$1),5),2-,33) $chan else { _sseen $nick($chan,$1) $ctime $+ $nick($chan,$1) $+ ! $+ $gettok($address($nick($chan,$1),5),2-,33) $chan _sseen $remove($gettok($gettok($address($nick($chan,$1),5),2-,33),1,64),~) $ctime $nick($chan,$1) $+ ! $+ $gettok($gettok($address($nick($chan,$1),5),2-,33),1,64) $+ @ $+ $gettok($address($nick($chan,$1),5),2-,64) $chan } } } on 1:part:#:{ updatenl if ($nick == $me) { set %.num $nick($chan,0) :loop | _dpseen %.num | if ($_vd(.num) > 0) goto loop } elseif ($comchan($nick,0) == 0) { if ($nick == $remove($gettok($address,1,64),~)) _sseen $nick $ctime $+ $nick $+ ! $+ $address $chan else { _sseen $nick $ctime $+ $nick $+ ! $+ $address $chan _sseen $remove($gettok($address,1,64),~) $ctime $nick $+ ! $+ $gettok($address,1,64) $+ @ $+ $site $chan } } } on 1:kick:#:{ updatenl if ($comchan($knick,0) == 0) { if ($knick == $remove($gettok($gettok($address($knick,5),2-,33),1,64),~)) _sseen $knick $ctime $+ $knick $+ ! $+ $gettok($address($knick,5),2-,33) $chan else { _sseen $knick $ctime $+ $knick $+ ! $+ $gettok($address($knick,5),2-,33) $chan _sseen $remove($gettok($gettok($address($knick,5),2-,33),1,64),~) $ctime $knick $+ ! $+ $gettok($gettok($address($knick,5),2-,33),1,64) $+ @ $+ $gettok($address($knick,5),2-,64) $chan } } } on !1:quit:{ if ($nick == $remove($gettok($address,1,64),~)) _sseen $nick $ctime $+ $nick $+ ! $+ $address $comchan($nick,1) else { _sseen $nick $ctime $+ $nick $+ ! $+ $address $comchan($nick,1) _sseen $remove($gettok($address,1,64),~) $ctime $nick $+ ! $+ $gettok($address,1,64) $+ @ $+ $site $comchan($nick,1) } } on 1:disconnect:{ if (%pp.net == Offline) return _flushseen set %.fil $_ppdir $+ lastseen.dat set %.num $ial(*,0) :loop | _dsseen %.num | if ($_vd(.num) > 0) goto loop } alias -l _dsseen { if (%+lastseen.onlyrecknown) if (($ial(*,$1).nick !isnotify) && ($maddress($ial(*,$1)) == $null)) return if ($comchan($ial(*,$1).nick,1) != $null) { if ($ial(*,$1).nick == $remove($ial(*,$1).user,~)) write -s [ $+ [ $ial(*,$1).nick ] ] %.fil $ial(*,$1).nick $ctime $+ $ial(*,$1).nick $+ ! $+ $ial(*,$1).addr $comchan($ial(*,$1).nick,1) else { write -s [ $+ [ $ial(*,$1).nick ] ] %.fil $ial(*,$1).nick $ctime $+ $ial(*,$1).nick $+ ! $+ $ial(*,$1).addr $comchan($ial(*,$1).nick,1) write -s [ $+ [ $remove($ial(*,$1).user,~) ] ] %.fil $remove($ial(*,$1).user,~) $ctime $ial(*,$1).nick $+ ! $+ $ial(*,$1).user $+ @ $+ $ial(*,$1).host $comchan($ial(*,$1).nick,1) } } } on !1:nick:_sseen $nick $ctime $+ $nick $+ ! $+ $address $comchan($newnick,1) #lastseen end alias _sseen { if (%+lastseen.onlyrecknown) if (($gettok($strip($3),1,33) !isnotify) && ($maddress($strip($3)) == $null)) return inc %_ssnum | set %_sseen. [ $+ [ %_ssnum ] ] $1- | if (%_ssnum >= 20) _flushseen } alias _flushseen { set %.fil $_ppdir $+ lastseen.dat set %.2fl 1 :loop _flushseen2 %_sseen. [ $+ [ %.2fl ] ] if ($_vi(.2fl) <= %_ssnum) goto loop unset %_ssnum %_sseen.* } alias -l _flushseen2 if ($1 != $null) write -s [ $+ [ $1 ] ] %.fil $1- alias _findseen { _flushseen if ($1 == $null) return No user specified if ((* isin $1) || (? isin $1) || (! isin $1) || (@ isin $1)) return Invalid user set %.fs $1 $+ !*@* if ($comchan($1,0) > 0) { if ((%+lastseen.hidechan) && ($2 != !)) set %.chan IRC else set %.chan $+ $comchan($1,1) $+ if ((%+lastseen.hideaddr) && ($2 != !)) set %.addr $+ $ial(%.fs,1).nick $+ else set %.addr $+ $ial(%.fs,1).nick $+ ! $+ $gettok($ial(%.fs,1),2-,33) return %.addr is on %.chan right now } if (($2 == !) || (%+lastseen.identdok)) { set %.fs *!* $+ $1 $+ @* if ($ial(%.fs,0) > 0) { if ((%+lastseen.hidechan) && ($2 != !)) set %.chan IRC else set %.chan $+ $comchan($ial(%.fs,1).nick,1) $+ if ((%+lastseen.hideaddr) && ($2 != !)) set %.addr $+ $ial(%.fs,1).user $+ (by identd) else set %.addr $ial(%.fs,1).nick $+ ! $+ $+ $ial(%.fs,1).user $+ @ $+ $ial(%.fs,1).host return %.addr is on %.chan right now } } if ($exists( [ [ $_ppdir ] $+ ] lastseen.dat) == $fasle) return My last seen data is empty. set %.fs $read -ns [ $+ [ $1 ] ] [ [ $_ppdir ] $+ ] lastseen.dat if (%.fs == $null) return I have not seen anyone matching $+ $1 $+ set %.who $gettok(%.fs,2,32) if ((! isin %.who) && ($_not(%+lastseen.identdok)) && ($2 != !)) return I have not seen anyone matching $+ $1 $+ if ((%+lastseen.hidechan) && ($2 != !)) unset %.chan else set %.chan , on $+ $gettok(%.fs,3,32) $+ if ((%+lastseen.hideaddr) && ($2 != !)) { set %.who z $+ %.who if (! isin %.who) set %.who $+ $gettok(%.who,2,31) $+ (by identd) else set %.who $+ $gettok(%.who,2,31) $+ } return %.who was last seen $duration($calc($ctime - $gettok(%.fs,1,32))) ago $+ %.chan } alias seen if ($1 == $null) _quickhelp /seen | dispa $_findseen($1,!) alias sayseen if ($1 == $null) _quickhelp /sayseen | say $_findseen($1) alias sseen sayseen $1- alias _mseen msg $1 $_findseen($2) alias clrseen { set %.file $_ppdir $+ lastseen.dat if ($_not($exists(%.file))) _error Seen database is already empty if ($1 == $null) { .remove %.file | dispa Seen database cleared. } else { _progress.1 Cleaning seen data older than $1 days... set %.old $calc($ctime - $1 * 86400) set %.max $lines(%.file) set %.cur 1 :loop set %.line $read -nl [ $+ [ %.cur ] ] %.file if ((%.line == $null) || ($gettok(%.line,2,32) < %.old)) { write -dl [ $+ [ %.cur ] ] %.file dec %.max } else inc %.cur if ($_vi(.per) > 5) { set %.per $int($calc(%.cur * 100 / %.max)) _progress.2 %.per Entry %.cur of %.max $+ ... unset %.per } if (%.cur <= %.max) goto loop _progress.2 100 Cleaning complete! } }